var http = require('http');

http.createServer(function(req, resp){
    var body = [];

    console.log('---req---')
    console.log(req.method);
    console.log(req.headers);

    console.log('---resp---')
    console.log(resp.statusCode);
    console.log(resp.headers);

    console.log('---data---')

    req.on('data', function(chunk){
        body.push(chunk);
    });

    req.on('end', function(){
        body = Buffer.concat(body);
        console.log(body.toString());
    });

}).listen(8080);